<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Hexo, NexT" />





  <link rel="alternate" href="/atom.xml" title="OBKoro1's Blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.2" />






<meta name="description" content="种一棵树最好的时间是十年前,其次是现在">
<meta property="og:type" content="website">
<meta property="og:title" content="OBKoro1&#39;s Blog">
<meta property="og:url" content="http://yoursite.com/tags/index.html">
<meta property="og:site_name" content="OBKoro1&#39;s Blog">
<meta property="og:description" content="种一棵树最好的时间是十年前,其次是现在">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-06-15T06:19:47.685Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="OBKoro1&#39;s Blog">
<meta name="twitter:description" content="种一棵树最好的时间是十年前,其次是现在">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.2',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/tags/"/>





  <title>标签 | OBKoro1's Blog</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?64d57d0b926bbd27431daa89d2e0a76b";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">OBKoro1's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-前端算法">
          <a href="/arithmetic/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            前端算法
          </a>
        </li>
      
        
        <li class="menu-item menu-item-博客最新更新">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            博客最新更新
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-commonweal">
          <a href="/404/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />
            
            公益404
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    
    
    
    <div class="post-block page">
      <header class="post-header">

	<h1 class="post-title" itemprop="name headline"></h1>



</header>

      
      
      
      <div class="post-body">
        
        
          <div class="tag-cloud">
            <div class="tag-cloud-title">
                目前共计 74 个标签
            </div>
            <div class="tag-cloud-tags">
              <a href="/tags/js-html5/" style="font-size: 12px; color: #ccc">-js - html5</a> <a href="/tags/Array/" style="font-size: 12px; color: #ccc">Array</a> <a href="/tags/CSS/" style="font-size: 12px; color: #ccc">CSS</a> <a href="/tags/Css/" style="font-size: 12px; color: #ccc">Css</a> <a href="/tags/Css-BFC作用域/" style="font-size: 12px; color: #ccc">Css-BFC作用域</a> <a href="/tags/ES6/" style="font-size: 14.25px; color: #b5b5b5">ES6</a> <a href="/tags/Eslint/" style="font-size: 12px; color: #ccc">Eslint</a> <a href="/tags/H5小游戏/" style="font-size: 12px; color: #ccc">H5小游戏</a> <a href="/tags/Html5/" style="font-size: 16.5px; color: #9d9d9d">Html5</a> <a href="/tags/Http缓存/" style="font-size: 12px; color: #ccc">Http缓存</a> <a href="/tags/VsCode/" style="font-size: 14.25px; color: #b5b5b5">VsCode</a> <a href="/tags/Vue/" style="font-size: 25.5px; color: #404040">Vue</a> <a href="/tags/Vue-cli/" style="font-size: 16.5px; color: #9d9d9d">Vue-cli</a> <a href="/tags/Vue-router/" style="font-size: 18.75px; color: #868686">Vue-router</a> <a href="/tags/Vuex/" style="font-size: 12px; color: #ccc">Vuex</a> <a href="/tags/WebWorker/" style="font-size: 14.25px; color: #b5b5b5">WebWorker</a> <a href="/tags/angular-ui-router/" style="font-size: 12px; color: #ccc">angular ui-router</a> <a href="/tags/axios/" style="font-size: 14.25px; color: #b5b5b5">axios</a> <a href="/tags/axios封装/" style="font-size: 12px; color: #ccc">axios封装</a> <a href="/tags/build空白页/" style="font-size: 12px; color: #ccc">build空白页</a> <a href="/tags/css/" style="font-size: 23.25px; color: #575757">css</a> <a href="/tags/css-sprite/" style="font-size: 12px; color: #ccc">css sprite</a> <a href="/tags/css3/" style="font-size: 12px; color: #ccc">css3</a> <a href="/tags/gzip文件压缩/" style="font-size: 12px; color: #ccc">gzip文件压缩</a> <a href="/tags/html/" style="font-size: 16.5px; color: #9d9d9d">html</a> <a href="/tags/http状态码/" style="font-size: 12px; color: #ccc">http状态码</a> <a href="/tags/indexOf数组去重/" style="font-size: 12px; color: #ccc">indexOf数组去重</a> <a href="/tags/jq/" style="font-size: 14.25px; color: #b5b5b5">jq</a> <a href="/tags/js/" style="font-size: 30px; color: #111">js</a> <a href="/tags/js-机制/" style="font-size: 21px; color: #6f6f6f">js 机制</a> <a href="/tags/js-demo/" style="font-size: 12px; color: #ccc">js_demo</a> <a href="/tags/js双向绑定/" style="font-size: 12px; color: #ccc">js双向绑定</a> <a href="/tags/js变量作用域/" style="font-size: 12px; color: #ccc">js变量作用域</a> <a href="/tags/js定时器/" style="font-size: 14.25px; color: #b5b5b5">js定时器</a> <a href="/tags/js闭包概念/" style="font-size: 12px; color: #ccc">js闭包概念</a> <a href="/tags/js随机数/" style="font-size: 12px; color: #ccc">js随机数</a> <a href="/tags/node/" style="font-size: 12px; color: #ccc">node</a> <a href="/tags/npm/" style="font-size: 12px; color: #ccc">npm</a> <a href="/tags/ps切图/" style="font-size: 14.25px; color: #b5b5b5">ps切图</a> <a href="/tags/range-radio-select-css样式/" style="font-size: 12px; color: #ccc">range  radio select css样式</a> <a href="/tags/removeAttribute/" style="font-size: 12px; color: #ccc">removeAttribute</a> <a href="/tags/sass/" style="font-size: 12px; color: #ccc">sass</a> <a href="/tags/shuffle/" style="font-size: 12px; color: #ccc">shuffle</a> <a href="/tags/split/" style="font-size: 12px; color: #ccc">split</a> <a href="/tags/vue-cli解析/" style="font-size: 12px; color: #ccc">vue-cli解析</a> <a href="/tags/vue-cli配置/" style="font-size: 16.5px; color: #9d9d9d">vue-cli配置</a> <a href="/tags/传参/" style="font-size: 12px; color: #ccc">传参</a> <a href="/tags/倒计时/" style="font-size: 12px; color: #ccc">倒计时</a> <a href="/tags/初始化vue-cli/" style="font-size: 12px; color: #ccc">初始化vue-cli</a> <a href="/tags/前端/" style="font-size: 12px; color: #ccc">前端</a> <a href="/tags/前端登录界面验证码详解/" style="font-size: 12px; color: #ccc">前端登录界面验证码详解</a> <a href="/tags/博客外链/" style="font-size: 12px; color: #ccc">博客外链</a> <a href="/tags/团队协作/" style="font-size: 12px; color: #ccc">团队协作</a> <a href="/tags/图片失效/" style="font-size: 12px; color: #ccc">图片失效</a> <a href="/tags/定时器/" style="font-size: 12px; color: #ccc">定时器</a> <a href="/tags/实践/" style="font-size: 12px; color: #ccc">实践</a> <a href="/tags/小demo/" style="font-size: 12px; color: #ccc">小demo</a> <a href="/tags/小白实现ajax请求/" style="font-size: 12px; color: #ccc">小白实现ajax请求</a> <a href="/tags/工具/" style="font-size: 14.25px; color: #b5b5b5">工具</a> <a href="/tags/微信/" style="font-size: 12px; color: #ccc">微信</a> <a href="/tags/性能/" style="font-size: 12px; color: #ccc">性能</a> <a href="/tags/时间差/" style="font-size: 12px; color: #ccc">时间差</a> <a href="/tags/标签栏favicon/" style="font-size: 12px; color: #ccc">标签栏favicon</a> <a href="/tags/正则表达式/" style="font-size: 12px; color: #ccc">正则表达式</a> <a href="/tags/浏览器机制/" style="font-size: 14.25px; color: #b5b5b5">浏览器机制</a> <a href="/tags/浏览器缓存/" style="font-size: 12px; color: #ccc">浏览器缓存</a> <a href="/tags/渐进增强和优雅降级/" style="font-size: 12px; color: #ccc">渐进增强和优雅降级</a> <a href="/tags/算法/" style="font-size: 27.75px; color: #282828">算法</a> <a href="/tags/组件/" style="font-size: 12px; color: #ccc">组件</a> <a href="/tags/网站随机背景/" style="font-size: 12px; color: #ccc">网站随机背景</a> <a href="/tags/读书笔记/" style="font-size: 12px; color: #ccc">读书笔记</a> <a href="/tags/键盘事件/" style="font-size: 12px; color: #ccc">键盘事件</a> <a href="/tags/面试/" style="font-size: 14.25px; color: #b5b5b5">面试</a> <a href="/tags/面试题/" style="font-size: 12px; color: #ccc">面试题</a>
            </div>
          </div>
        
      </div>
      
      
      
    </div>
    
    
    
  </div>


          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel sidebar-panel-active">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          
            <img class="site-author-image" itemprop="image"
              src="/uploads/hand1.jpg"
              alt="OBKoro1" />
          
            <p class="site-author-name" itemprop="name">OBKoro1</p>
            <p class="site-description motion-element" itemprop="description">种一棵树最好的时间是十年前,其次是现在</p>
        </div>

        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
            
              <a href="/archives">
            
                <span class="site-state-item-count">105</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">20</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">74</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/OBKoro1" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>GitHub</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://juejin.im/user/58714f0eb123db4a2eb95372" target="_blank" title="掘金">
                  
                    <i class="fa fa-fw fa-globe"></i>掘金</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://obkoro1.com/web_accumulate/" target="_blank" title="前端积累">
                  
                    <i class="fa fa-fw fa-globe"></i>前端积累</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://segmentfault.com/u/obkoro1/articles" target="_blank" title="segmentfault">
                  
                    <i class="fa fa-fw fa-globe"></i>segmentfault</a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2017 &mdash; 
  <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">OBKoro1</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">
      156.0k
    </span>
  
</div>




<div>
<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span class="site-uv"><i class="fa fa-user"></i> 访问用户： <span class="busuanzi-value" id="busuanzi_value_site_uv">21621</span> 人 </span>
<span class="site-pv"><i class="fa fa-eye"></i> 访问次数： <span class="busuanzi-value" id="busuanzi_value_site_pv">68503</span> 次</span>

</div>



        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

  
  <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.2"></script>



  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>


  

  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  




	





  





  








  



  





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("9ANFp60h6oVyxIPGlau3NOA4-gzGzoHsz", "tMdNuKMbFtN4QsekeNVu83TV");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  

  

  

</body>
</html>

